<!DOCTYPE html>
<html lang="zh-cn" class="no-js">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>{$seo_title}</title>
    <meta name="keywords" content="{$keywords}" />
    <meta name="description" content="{$description}" />
    <link href="{STATIC_URL}avatar/css/dgy.base.css" rel="stylesheet" type="text/css" />
    <link href="{STATIC_URL}avatar/css/dgy.head.css" rel="stylesheet" type="text/css" />
    <link href="{STATIC_URL}avatar/css/dgy.group.css" rel="stylesheet" type="text/css" />
    <link href="{STATIC_URL}avatar/css/dgy.layout.css" rel="stylesheet" type="text/css" />
    <link href="//at.alicdn.com/t/font_958938_n3j31its8x.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="{STATIC_URL}avatar/js/jquery-2.1.4.min.js"></script>
    <script type="text/javascript" src="{STATIC_URL}avatar/js/baseMotheds.js"></script>
    <script type="text/javascript" src="{STATIC_URL}plugin/layer/3.0.1/layer.js"></script>
    <script type="text/javascript" src="{STATIC_URL}avatar/plugin/layui/layui.js"></script>
    <script type="text/javascript" src="{STATIC_URL}avatar/js/detailMotheds.js"></script>
	<script type="text/javascript" src="{STATIC_URL}avatar/js/digg.js"></script>
	
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.4.2/css/swiper.min.css">
</head>
<body>
    <div class="fixedHeadSwitch">
        {m:include "index","header"}
    </div>
            
    <!-- baseGroup -->
    <div class="baseGroup mt100 w1100 layoutAuto">
        <!-- detailGrid -->
        <div class="detailGrid web">
            
            <div class="webHeadLabel">
                <div class="webImg" style="background:url('{$thumb}') no-repeat; background-size:cover;"></div>
                <a href="{$webSite}" target="_blank" class="website" style="right:0;">立即访问</a>
                <h1 class="title">{$title}</h1>
                <p class="info">
                    {$webTag}
                </p>
            </div>
            
            <!-- 介绍 -->
            <div class="commonHeadLabel small mt40">
               <div class="title">介绍</div>
            </div>
            <article class="articleDetailGroup">
                {$content}
            </article>
            
            <!-- 预览 -->
            <div class="commonHeadLabel small mt40">
               <div class="title">预览</div>
            </div>
            <div class="launchTopGird web">
                <div class="swiper-container" id="webImgGrid">
                    <div class="swiper-wrapper">
                        {php $webImgArray = string2array($webImgArray);}
    					{loop $webImgArray $v}
                        <div class="swiper-slide">
        	                <div class="imgBox">
        	                    <img class="img" src="{$v[url]}" alt="{$v[alt]}" title="{$v[alt]}">
        	                </div>
        	            </div>
        			    {/loop}
        		    </div>
                    <div class="swiper-button-prev"></div>
                    <div class="swiper-button-next"></div>
                </div>
            </div>
            
			<!-- zanGroup -->
			<div id="pt-cms_digg_div" class="zanGroup">
				<div class="zanBtn" onclick="digg('{U('digg/init')}', {$modelid}, {$id}, 1)">
				    <i class="iconfont icon-zan"></i>
				</div>
				<p><span id="up" class="numFont2">{$up}</span></p>
			</div>
    		<div class="clearfix"></div>
            <div class="mt80 mb20" style="border-top:1px solid #eee"></div>
    		
    	    <!-- 猜你喜欢 -->
            <div class="commonHeadLabel small mt40">
               <div class="title">猜你喜欢</div>
            </div>
            <div class="newArticleGrid link web">
                {m:lists field="title,url,thumb,description,webTag" modelid="$modelid" order="RAND()" limit="3"}
    		    {loop $data $v}
    		    <div class="itemLi">
                    <a href="{$v[url]}" target="_blank" class="content">
                        <div class="img" style="background:url('{$v[thumb]}') no-repeat; background-size:cover;"></div>
                        <h2>{str_cut($v['title'], 80)}</h2>
                        <p>{$v[webTag]}</p>
                    </a>
    		    </div>
    		    {/loop}
    		    <div class="clearfix"></div>
            </div>
            
    		<!-- 评论区 开始 -->
            <div class="commonHeadLabel small mt80">
               <div class="title">评论列表</div>
            </div>
    		<div class="commentGrid">
    			<div class="commentForm">
        			<form action="{U('comment/index/init')}" method="post" onsubmit="return check_comm(this)">
            			<input type="hidden" name="modelid" value="{$modelid}">
            			<input type="hidden" name="catid" value="{$catid}">
            			<input type="hidden" name="id" value="{$id}">
            			<input type="hidden" name="title" value="{$title}">
            			<input type="hidden" name="url" value="{$url}">
            			<textarea class="commentTextarea" id="content" name="content" placeholder="我来说两句~"></textarea>
				        <div class="btnBox"><input type="submit" class="submitBtn" name="dosubmit" value="提交"></div>
        			</form>
    			</div>
    			
    		    <!-- 评论列表 -->
        		<div class="commentList">
        			{m:comment_list modelid="$modelid" catid="$catid" id="$id" limit="20"}
        			<div class="title">共{count($data)}条评论</div>
        			<div class="commentGrid">
            			<ul class="itemUl">
            				{loop $data $v}
            				<li class="item">
        						<div class="username"># <a href="{U('member/myhome/init', array('userid'=>$v['userid']))}" target="blank">{$v[username]}</a> <span>{date('Y/m/d H:i:s',$v['inputtime'])}</span><a href="javascript:toreply('{$v[id]}');" class="reply">回复</a></div>
        						<div class="commentGroup">
        						    <p>{nl2br($v['content'])}</p>
            						<div id="rep_{$v[id]}" style="display:none">
                						<form action="{U('comment/index/init')}" method="post" onsubmit="return check_rep(this)">
                    						<input type="hidden" name="modelid" value="{$modelid}">
                    						<input type="hidden" name="catid" value="{$catid}">
                    						<input type="hidden" name="id" value="{$id}">
                    						<input type="hidden" name="title" value="{$title}">
                    						<input type="hidden" name="url" value="{$url}">
                    						<input type="hidden" name="reply" value="{$v[id]}">
                    						<input type="hidden" name="reply_to" value="{$v[username]}">
                    						<textarea name="content" class="commentTextarea reply" placeholder="我来说两句~"></textarea>
                    						<div class="btnBox"><input type="submit" class="submitBtn" name="dosubmit" value="提交"></div>
                						</form>
            						</div>
            						
        						</div>
            				</li>
            				{/loop}
            				{if empty($data)}<li class="tips">这篇文章还没有收到评论，赶紧来抢沙发吧~</li>{/if}
            			</ul>
        			</div>
        		</div>
        		
    		</div>
    		
    	</div>	
    </div>
    
    <script src="https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.4.2/js/swiper.min.js"></script>
    <script>        
    $(function(){
        var indexFocusSwiper = new Swiper ('#webImgGrid', {
            slidesPerView: 2,
            spaceBetween: 20,
            navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev',},
            //loop: true,
        }) 
    });
    </script>
    <!-- footer -->
    <footer class="bgfa" style="position:relative; z-index:10;">
    {m:include "index","footer"}
    </footer>
    
    <script>
        function add_favorite(title) {
        	$.ajax({
        		type: 'POST',
        		url: '{U("api/index/favorite")}', 
        		data: 'title='+title+'&url='+location.href,
        		dataType: "json", 
        		success: function (msg) {
        			if(msg.status == 1){
        				$("#favorite").html('收藏成功');
        			}else{
	                    layer.msg('请先登录!');
        			}
        		}
        	});
        };

        layui.use('code', function(){
            layui.code();
            layui.code({
              elem: 'pre',
              encode: true,
              title: '#示例代码',
              about: false
            });
        });
    </script>
    
  </body>
</html>